Skip to main content

Model Generator

Model Generator is a custom library for dealing with data fetching and state management. It provides basic CRUD functionality out of the box that are compatible with the standard APIs at Rexlabs.

Model Generator is using the redux store under the hood, with means you can inspect the current state and state changes using the Redux DevTools

Install

$ yarn add @rexlabs/model-generator

Why?

Setting up projects using Redux, even more when dealing API data, is tedious and brings a lot of redux boilerplate with it to get it right. Besides the redundancy of defining CRUD actions for all your API entities, you also need to deal with proper normalisation of the redux store. A lot of repetitive work.

model-generator tries to solve this problem, sitting on top of redux as an abstraction layer. It provides you with pre-defined CRUD actions, as well as proper state normalisation (incl. dealing with entity relations, grabage collection, etc.). Also it simplifies writing custom actions, synchronous and asynchronous, using the redux-thunk middleware.

Guides

API reference